<!DOCTYPE html>
<meta charset="utf-8">
<meta name="assert" content="This checks that 'box-sizing: border-box' doesn't have any effect on a positioned element that is warpping a replaced element, when the height of the positioned element is set by the offset properties.">
<style>
.wrapper {
  position: relative;
  width: 200px;
  height: 200px;
}

.positioned {
  border: 10px solid magenta;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

iframe {
  border: 20px dotted cyan;
  background: yellow;
  width: 100%;
  height: 100%;
}

.border-box {
  box-sizing: border-box;
}
</style>

<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/check-layout-th.js"></script>

<body onload="checkLayout('.wrapper')">

<div id="log"></div>

<div class="wrapper" data-expected-width="200" data-expected-height="200">
  <div class="positioned" data-expected-width="200" data-expected-height="200">
    <iframe data-expected-width="220" data-expected-height="220"></iframe>
  </div>
</div>

<div class="wrapper" data-expected-width="200" data-expected-height="200">
  <div class="positioned" data-expected-width="200" data-expected-height="200">
    <iframe class="border-box" data-expected-width="180" data-expected-height="180"></iframe>
  </div>
</div>

<div class="wrapper" data-expected-width="200" data-expected-height="200">
  <div class="positioned border-box" data-expected-width="200" data-expected-height="200">
    <iframe data-expected-width="220" data-expected-height="220"></iframe>
  </div>
</div>

<div class="wrapper" data-expected-width="200" data-expected-height="200">
  <div class="positioned border-box" data-expected-width="200" data-expected-height="200">
    <iframe class="border-box" data-expected-width="180" data-expected-height="180"></iframe>
  </div>
</div>

</body>
